﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustomerRelation.Edit.aspx.cs"
    Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Quan tri he thong</title>
    <link href="assets/jquery/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="assets/css/reset.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/styleexpress.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/invalid.css" type="text/css" media="screen" />
    <script src="assets/js/jquery-1.4.2.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery-ui.min.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.dialog.extra.js" type="text/javascript"></script>
    <script src="assets/js/jquery.validate.js" type="text/javascript"></script>
    <script type='text/javascript' src="assets/js/common.js"></script>
    <script type='text/javascript' src="assets/js/jquery.autocomplete.js"></script>
    <script type='text/javascript' src="assets/js/Ports.js"></script>
    <script type='text/javascript' src="assets/js/Carrs.js"></script>
    <script type='text/javascript' src="assets/js/DomesticPOR.js"></script>
    <link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" />
    <script type='text/javascript' src="assets/js/jquery.ui.datepicker.js"></script>
    <style type="text/css">
        .thheader {
            font-weight: bold;
            vertical-align: middle;
            text-align: center;
            font-size: 11px;
            border: 1px solid #ccc !important;
            line-height: 12px !important;
        }

        .tdboder {
            border: none !important;
        }

            .tdboder p {
                padding: 1px !important;
                width: 40px;
                border: 1px solid #ccc !important;
                border-bottom: 1px solid #ccc !important;
            }

        .rdCustStyle {
            margin-left: 20px;
        }

            .rdCustStyle table {
                border-collapse: separate !important;
                ;
            }
    </style>
    <script type="text/javascript">
        var ID = '<%=Request.QueryString["ID"] %>';
        function doDelete(ExtID, CustID, Action) {
            if (confirm('Bạn có thực sự muốn xóa?')) {
                var tid = getUrlVars()['tid'];
                window.location.href = "CustomerRelation.Edit.aspx?tid=" + tid + "&action=" + Action + "&ID=" + CustID + "&ExtID=" + ExtID;
            }
        }
        function doOpenCosting(obj, ExtID, CustID) {
            var objTR = $(obj).parent().parent();
            var bHasValue = false;
            var nCount = 0;
            $(objTR).find('input[type=text]').each(function (index, item) {
                //alert("index=" + index + " value=" + item.value);
                if (index > 2 && index < 14 && item.value.length > 0) {
                    bHasValue = true;
                    nCount += 1;
                }
            });
            if (!bHasValue) {
                alert("Phải nhập giá mua và bán trước khi làm costing.");
                return false;
            }
            var tid = getUrlVars()['tid'];
            url = "CostingDetail.aspx?tid=" + tid + "&CustID=" + CustID + "&ExtID=" + ExtID;
            window.open(url, 'CostingDetail', 'width=800,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
        }
        function doOpenCosted(ExtID, CustID) {
            var tid = getUrlVars()['tid'];
            url = "CostingDetail.aspx?tid=" + tid + "&CustID=" + CustID + "&ExtID=" + ExtID;
            window.open(url, 'CostedDetail', 'width=800,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
        }
        function doOpenQuantity(OfferPriceID, CustID, Status) {
            var tid = getUrlVars()['tid'];
            url = "OfferPriceQuantity.aspx?view=" + Status + "&CustID=" + CustID + "&OfferPriceID=" + OfferPriceID;
            window.open(url, 'OfferPriceQuantity', 'width=800,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');
        }
        function ReloadOpener() {
            var tid = getUrlVars()['tid'];
            var pageno = getUrlVars()["page_number"];
            var ext = "";
            ext = "tid=" + tid;
            if (typeof pageno != "undefined") {
                ext += "&page_number=" + pageno;
            }
            window.opener.location.href = "CustomerRelation.aspx?" + ext;
            window.close();
        }
        $().ready(function () {
            $('.clsPol').focus().autocomplete(ports);
            $('.clsPod').focus().autocomplete(ports);
            $('.clsCarr').focus().autocomplete(carrs);
            $('#txtAddress').focus().autocomplete(por);
            $('#txtGoods').focus();
            jQuery.ajax({
                type: "POST",
                url: "Handlers/Event.ashx?action=listusername",
                success: function (msg) {
                    lregion = eval('(' + msg + ')');
                    $('.clsPricingName').autocomplete(lregion);
                }
            });
            var scroll = function (div) {
                var totalHeight = 0;
                div.find('.post').each(function () {
                    totalHeight += $(this).outerHeight();
                });
                div.scrollTop(totalHeight);
            }
            // call it:
            scroll($('#divscroll1')); scroll($('#divscroll2'));
            $("#txtFrom").datepicker({ dateFormat: "dd-mm-yy" });
            $("#txtTo").datepicker({ dateFormat: "dd-mm-yy" });
        });
        var nCurrentPage = 0;
        function ShowMore(showType) {
            nCurrentPage += 1;
            $.ajax({
                type: 'POST',
                url: "Handlers/UpdateCustomerRelation.ashx",
                data: { ID: ID, offerprice: "offerprice", page_number: nCurrentPage, showtype: showType },
                success: function (data) {
                    console.log(data);
                    //                    var s = jQuery.parseJSON(data);
                    //                    console.log(data.Message.length);
                    //                    console.log(s.Message.length);
                    var html = "";
                    if (data.length > 0) {
                        var cnt = $("#trshowmore").parent().children("tr").length - 2;
                        $.each(data, function (i, item) {
                            cnt++;
                            html += '<tr style="background-color: rgb(255, 255, 255); background-position: initial initial; background-repeat: initial initial;">';
                            html += '<td align="center">';
                            html += cnt;
                            html += '</td>';
                            html += '<td align="center">';
                            html += item.strCostNumber;
                            html += '</td>';
                            html += '<td align="center">';
                            html += item.Pol;
                            html += '</td>';
                            html += '<td align="center">';
                            html += item.Pod;
                            html += '</td>';
                            //html += '<td align="center" style="width: 30px;">';
                            //html += '</td>';
                            html += '<td>';
                            html += item.Dc20;
                            html += '</td>';
                            html += '<td>';
                            html += item.Dc20_Sell;
                            html += '</td>';
                            html += '<td>';
                            html += item.Dc40;
                            html += '</td>';
                            html += '<td>';
                            html += item.Dc40_Sell;
                            html += '</td>';
                            html += '<td>';
                            html += item.Hc40;
                            html += '</td>';
                            html += '<td>';
                            html += item.Hc40_Sell;
                            html += '</td>';
                            html += '<td>';
                            html += item.Rf20;
                            html += '</td>';
                            html += '<td>';
                            html += item.Rf20_Sell;
                            html += '</td>';
                            html += '<td>';
                            html += item.Rf40;
                            html += '</td>';
                            html += '<td>';
                            html += item.Rf40_Sell;
                            html += '</td>';
                            html += '<td>';
                            html += item.CBM;
                            html += '</td>';
                            html += '<td>';
                            html += item.CBM_Sell;
                            html += '</td>';
                            //html += '<td>';
                            //html += item.KG;
                            //html += '</td>';
                            //html += '<td>';
                            //html += item.KG_Sell;
                            //html += '</td>';
                            html += '<td>';
                            html += item.Agent;
                            html += '</td>';
                            html += '<td>';
                            html += item.PricingName;
                            html += '</td>';
                            html += '<td>';
                            html += item.OfferPrice_Note;
                            html += '</td>';
                            html += '<td align="center">';
                            html += item.LastUpdate
                            html += '</td>';
                            html += '<td align="center">';
                            html += item.strAction;
                            html += '</td>';
                            html += '</tr>';
                        });
                        $("#trshowmore").before(html);
                        //$("#trshowmore").hide();
                    }
                },
                dataType: "json"
            });
        }
    </script>
    <script type="text/javascript">
        function doAddReminder(PlanID, CustID) {
            jQuery(function () {
                _url = "cal_events.aspx?action=add&type=1&PlanID=" + PlanID + "&CustID=" + CustID;
                _html = "<iframe id=\"url_doctor\" scrolling=\"no\" onload=\"jQuery(this).height(jQuery(this).contents().height());\" style=\"width:50%;border:0;height:200px\" name=\"url_doctor\" src=\"" + _url + "\"></iframe>";
                jQuery("#dialog-modal").html(_html);
                jQuery("#dialog:ui-dialog").dialog("destroy");
                jQuery("#dialog-modal").dialog({
                    canMinimize: true,
                    position: ['right', 'bottom'],
                    minimize: true,
                    //canMaximize:true,
                    title: 'REMINDERS',
                    //modal: true,
                    height: 225,
                    width: 395,
                    open: function () {
                        jQuery('#dialog-modal iframe').height($(this).height() - 40);
                        jQuery('#dialog-modal iframe').width($(this).width() - 10);
                    },
                    resize: function () { },
                    resizeStop: function () {
                        jQuery('iframe').show();
                        jQuery('#dialog-modal iframe').height($(this).height() - 10);
                        jQuery('#dialog-modal iframe').width($(this).width() - 10);
                    }
                });
            });
        }
    </script>
    <style type="text/css">
        input[type=text], input[type=password], textarea, select {
            border: none;
        }

            input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
                border-color: #4488cc;
                border-style: solid;
                border-width: 1px;
                margin: 0;
                background-color: #FCFFC5 !important;
            }

        .row {
            border-bottom: 1px solid #E9E9E9;
        }

        #backgroundPopup {
            display: none;
            position: fixed;
            _position: absolute; /* hack for internet explorer 6*/
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            background: #000000;
            border: 1px solid #cecece;
            z-index: 1;
        }

        #close {
            width: 61px;
            height: 20px;
            display: block;
            position: absolute;
            top: 340px;
            left: 360px;
            overflow: hidden;
        }

        #btnCancel {
            color: #FFFFFF;
            cursor: pointer;
        }

        .contact-top {
            text-align: right;
        }

        .view10row {
            float: left;
            height: 475px;
            top: 0px;
            vertical-align: top;
            display: inline;
            overflow-y: scroll;
            overflow-x: no;
            width: 100%;
        }

        #rdCustType td {
            background-color: #e5e5e5;
        }

        #rdCustType label {
            line-height: 20px;
            margin-top: -16px;
            padding-left: 20px;
        }

        #rdCustType input {
            margin-top: 10px;
            padding-left: 40px;
        }
    </style>
</head>
<body>
    <div id="dialog-modal">
    </div>
    <div id="body-wrapper">
        <div id="main-content1" style="padding: 0px; margin-left: 5px;">
            <div class="">
            </div>
            <h2>Quản lý quan hệ Khách hàng</h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmEdit" runat="server" method="post">
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">Thông tin khách hàng :
                        <%Response.Write(strCustomerName + "  "); Response.Write(strCustomerAdminOwner); %>
                        </h3>
                        <div class="clear">
                        </div>
                    </div>
                    <table>
                        <tr>
                            <td>
                                <fieldset class="adminform">
                                    <table class="paramlist admintable " width="100%">
                                        <%if (strError != "")
                                          {%>
                                        <tr>
                                            <td colspan="2">
                                                <em style="color: Red;">
                                                    <% = strMess %>
                                                </em>
                                            </td>
                                        </tr>
                                        <%} %>
                                        <tr>
                                            <td class="key" align="left">Tên hàng XK:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtGoods" name="txtGoods" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">Tên hàng NK:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtGoodsEx" name="txtGoodsEx" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left">HS XK:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtHsGoods" name="txtHsGoods" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">HS NK:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtHsGoodsEx" name="txtHsGoodsEx" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" style="width: 160px;">Tên Công ty khách hàng: (<span style="color: red;">*</span>)
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtName" name="txtName" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">Pic:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtPic" name="txtPic" runat="server" Width="85%"></asp:TextBox>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Địa chỉ:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtAddress" name="txtAddress" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">Position:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtPosion" name="txtPosion" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Tel:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtTel" name="txtTel" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">POL:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtPOL" name="txtPOL" runat="server" Width="85%"></asp:TextBox>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Mobile:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtMobile" name="txtMobile" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">POD:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtRouter" name="txtRouter" runat="server" Width="85%"></asp:TextBox>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Email:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtEmail" name="txtEmail" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">Vol / month:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtVol" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Other:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtOther" name="txtOther" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">Social:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtSocial" name="txtSocial" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">MST:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtCode" name="txtCode" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                            <td class="key" align="left" width="20%">Report
                                            </td>
                                            <td align="left" class="row">
                                                <asp:TextBox ID="txtReport" name="txtReport" runat="server" Width="85%"></asp:TextBox>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </td>
                            <td>
                                <%if (Request.QueryString["tid"].ToString() == "1")
                                  { %>
                                <fieldset class="adminform">
                                    <table class="paramlist admintable " width="100%">
                                        <tr>
                                            <td class="key" colspan="4" style="text-align: left; font-weight: bold; color: Black; font-size: 16px;">Phân loại khách hàng:
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" style="width: 160px;">Loại khách hàng:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:Label ID="lblCusLevel" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Ngày ký hợp đồng:
                                            </td>
                                            <td align="left" class="">
                                                <asp:Label ID="lblCusLevelContractStartDate" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" style="width: 160px;">Công nợ (ngày):
                                            </td>
                                            <td align="left" class="row">
                                                <asp:Label ID="lblCusLevelLiabilities" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Ngày hết hạn hợp đồng:
                                            </td>
                                            <td align="left" class="">
                                                <asp:Label ID="lblCusLevelContractEndDate" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" style="width: 160px;">TB (%):
                                            </td>
                                            <td align="left" class="row">
                                                <asp:Label ID="lblCusLevelTB" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Phát sinh nợ đến nay:
                                            </td>
                                            <td align="left" class="">
                                                <asp:Label ID="lblCusLevelDebts" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" style="width: 160px;">Hạn mức:
                                            </td>
                                            <td align="left" class="row">
                                                <asp:Label ID="lblCusLevelCusLimit" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="key" align="left" width="20%">Note:
                                            </td>
                                            <td align="left" class="">
                                                <asp:Label ID="lblCusLevelNote" runat="server" Width="85%"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                                <%} %>
                            </td>
                        </tr>
                    </table>
                    <!--Customer Offer Prices-->
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">Giá offer cho khách hàng
                        </h3>
                        <asp:TextBox ID="txtFrom" CssClass="calendar-icon" runat="server" value="From" onclick="if(this.value=='From'){this.value=''; this.style.color='#000'}"
                            onblur="if(this.value==''){this.value='From'; this.style.color='#555'}" Width="125px"></asp:TextBox>
                        <asp:TextBox ID="txtTo" CssClass="calendar-icon" runat="server" value="To" Width="125px"
                            onclick="if(this.value=='To'){this.value=''; this.style.color='#000'}" onblur="if(this.value==''){this.value='To'; this.style.color='#555'}"></asp:TextBox>
                        <asp:Button ID="btnSearch" Text="Search" runat="server" CssClass="button" Style="margin: 9px 10px;"
                            OnClick="btnSearch_Click" />
                        <div style="float: right; margin: 9px 10px;">
                            Hiển thị:
                            <asp:DropDownList ID="ddIppOfferPrice" runat="server" AutoPostBack="true" OnSelectedIndexChanged="btnSearch_Click">
                                <asp:ListItem Text="5" Value="5" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="10" Value="10"></asp:ListItem>
                                <asp:ListItem Text="30" Value="30"></asp:ListItem>
                                <asp:ListItem Text="50" Value="50"></asp:ListItem>
                                <asp:ListItem Text="All" Value=""></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                    <div id="divscroll1" <%if (NumOfItems1 > 10)
                                           { %>class="view10row"
                        <%} %>>
                        <fieldset>
                            <asp:Repeater ID="rptCusomerOfferPrices" runat="server">
                                <ItemTemplate>
                                    <%  if (BindCostStatus == 0)
                                        { %>
                                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                            <asp:HiddenField ID="ID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ID")%>'></asp:HiddenField>
                                        </td>
                                        <td align="center">
                                            <asp:Label ID="FileNo" runat="server" Width="100%" Text='<%# DataBinder.Eval(Container.DataItem, "CostNumber")%>'
                                                CssClass="clsPod"></asp:Label>
                                        </td>
                                        <td align="center">
                                            <asp:TextBox ID="Pol" runat="server" Width="98%" Text='<%# DataBinder.Eval(Container.DataItem, "Pol")%>'
                                                CssClass="clsPod"></asp:TextBox>
                                        </td>
                                        <td align="center">
                                            <asp:TextBox ID="Pod" runat="server" Width="98%" Text='<%# DataBinder.Eval(Container.DataItem, "Pod")%>'
                                                CssClass="clsPod"></asp:TextBox>
                                        </td>
                                        <%-- <td align="center" style="width: 40px;">
                                        <asp:TextBox ID="Vols" runat="server" Width="98%" Text='<%# DataBinder.Eval(Container.DataItem, "Vols")%>'></asp:TextBox>
                                    </td>--%>
                                        <td>
                                            <asp:TextBox ID="Dc20" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Dc20")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Dc20_Sell" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Dc20_Sell")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Dc40" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Dc40")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Dc40_Sell" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Dc40_Sell")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Hc40" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Hc40")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Hc40_Sell" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Hc40_Sell")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Rf20" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Rf20")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Rf20_Sell" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Rf20_Sell")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Rf40" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Rf40")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="Rf40_Sell" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Rf40_Sell")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="CBM" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "CBM")%>'></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="CBM_Sell" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "CBM_Sell")%>'></asp:TextBox>
                                        </td>
                                        <%-- <td>
                                        <asp:TextBox ID="KG" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "KG")%>'></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="KG_Sell" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "KG_Sell")%>'></asp:TextBox>
                                    </td>--%>
                                        <td>
                                            <asp:TextBox ID="Agent" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "Agent")%>'
                                                CssClass="clsCarr"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="PricingName" runat="server" Width="80px" Text='<%# DataBinder.Eval(Container.DataItem, "PricingName")%>'
                                                CssClass="clsPricingName"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="OfferPrice_Note" runat="server" Width="40px" Text='<%# DataBinder.Eval(Container.DataItem, "OfferPrice_Note")%>'></asp:TextBox>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                        </td>
                                    </tr>
                                    <%}
                                        else
                                        { %>
                                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                        </td>
                                        <td align="center">
                                            <asp:Label ID="Label1" runat="server" Width="100%" Text='<%# DataBinder.Eval(Container.DataItem, "CostNumber")%>'
                                                CssClass="clsPod"></asp:Label>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Pol")%>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Pod")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Dc20")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Dc20_Sell")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Dc40")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Dc40_Sell")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Hc40")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Hc40_Sell")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Rf20")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Rf20_Sell")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Rf40")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Rf40_Sell")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "CBM")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "CBM_Sell")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "Agent")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "PricingName")%>
                                        </td>
                                        <td>
                                            <%# DataBinder.Eval(Container.DataItem, "OfferPrice_Note")%>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                        </td>
                                    </tr>
                                    <%} %>
                                </ItemTemplate>
                                <HeaderTemplate>
                                    <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                                        <thead>
                                            <tr>
                                                <th align="center" class="thheader" width="30px">Stt
                                                </th>
                                                <th align="center" class="thheader" width="50px">File No
                                                </th>
                                                <th align="center" class="thheader" width="150px">Pol
                                                </th>
                                                <th align="center" class="thheader" width="150px">Pod
                                                </th>
                                                <%-- <th align="center" class="thheader" width="30px">
                                                Vol
                                            </th>--%>
                                                <th align="center" class="thheader" width="50px" colspan="2">20'dc
                                                </th>
                                                <th align="center" class="thheader" colspan="2">40'dc
                                                </th>
                                                <th align="center" class="thheader" colspan="2">40'hc
                                                </th>
                                                <th align="center" class="thheader" colspan="2">20'rf
                                                </th>
                                                <th align="center" class="thheader" colspan="2">40'rf
                                                </th>
                                                <th align="center" class="thheader" colspan="2">CBM/KG
                                                </th>
                                                <%-- <th align="center" class="thheader" colspan="2">
                                                KG
                                            </th>--%>
                                                <th align="center" class="thheader" width="50px">Agent
                                                </th>
                                                <th align="center" class="thheader" width="80px">Pricing Name
                                                </th>
                                                <th align="center" class="thheader" width="50px">Note
                                                </th>
                                                <th align="center" class="thheader" width="50px">Update
                                                </th>
                                                <th align="center" class="thheader" width="100px">Action
                                                </th>
                                            </tr>
                                        </thead>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    <tr id="trshowmore">
                                        <td colspan="23" style="text-align: center;">
                                            <%-- <a href="#" onclick="ShowMore('more');">Show More</a>--%>
                                        </td>
                                    </tr>
                                    </TABLE>
                                </FooterTemplate>
                            </asp:Repeater>
                        </fieldset>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="content-box-header">
                        <h3 style="cursor: s-resize;">Mô tả giao tiếp và kế hoạch hành động
                        </h3>
                        <asp:RadioButtonList ID="rdCustType" runat="server" AutoPostBack="TRUE" RepeatDirection="Horizontal"
                            Width="280px" OnSelectedIndexChanged="rdCustType_SelectedIndexChanged" BackColor="#e5e5e5">
                            <asp:ListItem Value="1" Text="EXTREME PO"></asp:ListItem>
                            <asp:ListItem Value="2" Text="CHASE BKG"></asp:ListItem>
                            <asp:ListItem Value="0" Text="NONE"></asp:ListItem>
                        </asp:RadioButtonList>
                        <div style="float: right; margin: 9px 10px;">
                            Hiển thị:
                        <asp:DropDownList ID="ddIppActionPlan" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddIppActionPlan_SelectedIndexChanged">
                            <asp:ListItem Text="5" Value="5" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="10" Value="10"></asp:ListItem>
                            <asp:ListItem Text="30" Value="30"></asp:ListItem>
                            <asp:ListItem Text="50" Value="50"></asp:ListItem>
                            <asp:ListItem Text="All" Value=""></asp:ListItem>
                        </asp:DropDownList>
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                    <div id="divscroll2" <%if (NumOfItems2 > 10)
                                           { %>class="view10row"
                        <%} %>>
                        <fieldset>
                            <asp:Repeater ID="rptActionPlan" runat="server">
                                <ItemTemplate>
                                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                            <asp:HiddenField ID="ID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ID")%>'></asp:HiddenField>
                                        </td>
                                        <td align="center">
                                            <asp:TextBox ID="Description" runat="server" Width="98%" Text=' <%# DataBinder.Eval(Container.DataItem, "Description") %>'></asp:TextBox>
                                        </td>
                                        <td align="center">
                                            <asp:TextBox ID="ActionPlan" runat="server" Width="98%" Text='<%# DataBinder.Eval(Container.DataItem, "ActionPlan") %>'></asp:TextBox>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                                        </td>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <HeaderTemplate>
                                    <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                                        <thead>
                                            <tr>
                                                <th align="center" class="thheader" width="30px">Stt
                                                </th>
                                                <th align="center" class="thheader" width="60%">Mô tả giao tiếp
                                                </th>
                                                <th align="center" class="thheader">Kế hoạc đeo đuổi
                                                </th>
                                                <th align="center" class="thheader" width="50px">Update
                                                </th>
                                                <th align="center" class="thheader" width="50px">Action
                                                </th>
                                            </tr>
                                        </thead>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    </TABLE>
                                </FooterTemplate>
                            </asp:Repeater>
                        </fieldset>
                    </div>
                    <div class="clear" style="height: 32px">
                    </div>
                    <style type="text/css">
                        #footer {
                            padding: 2px;
                            border: 1px solid #5b958e;
                            background-color: #e9eae5;
                            width: 98%;
                            left: 1px;
                            bottom: 0px;
                            position: fixed;
                            height: 30px;
                        }
                    </style>
                    <div style="display: inline;" id="footer">
                        <asp:Button ID="btnSave" runat="server" Text="Update" class="button" OnClick="btnSave_Click" />
                        <input type="button" id="Exit" value="Exit" class="button" onclick="ReloadOpener();" />
                    </div>
                </form>
            </div>
            <!--div id="footer">
                &nbsp;</div-->
        </div>
    </div>
    <div id="rebate_form" class="simplemodal-container" style="display: none; position: absolute; z-index: 1002; width: 340px; height: 250px; left: 332px; top: 10%;">
        <div tabindex="-1" class="simplemodal-wrap" style="outline: 0px none; width: 100%;">
            <div style="" id="simplemodal-datas" class="simplemodal-datas">
                <div class="contact-top">
                    <a id="btnCancel">[X] Close</a>
                </div>
                <div class="contact-content" style="height: 100%; display: block;">
                    <div class="contactArea" style="display: block; background: #fff;">
                    </div>
                </div>
                <div class="contact-bottom">
                </div>
            </div>
        </div>
    </div>
</body>
</html>
